Before you start running the program in GDB, you need to generate debugging information at compile time.You can start gdb with parameters (if any) in your chosen environment. If you are debugging locally, you can redirect the input output, debug a
Turn from: http://blog.csdn.net/haoahua/article/details/2056854
the original text is from the Chenhao column (http://blog.csdn.net/haoel/), thanks to the author for publishing such a good article.
Debug a program with GDB
Debug the program with
View stack information-----
When the program is stopped, the first thing you need to do is to check where the program stops. When your programWhen a function is called, the address, parameters, and local variables in the function are pushed
Enter and exit GDB
This section discusses how to start and exit gdb. Mainly include: input ' gdb ' into the GDB debugger input quit or press ctrl-d exit call GDB: How to start GDB exit GdB: How to exit gdb Shell script command: How to save the
Debug the program with GDB
GDB Overview----
GDB is a powerful Unix program debugging tool released by the GNU open-source organization. Maybe you prefer the graphical interface, such as Vc, BCB, and other ideBut if you are working on a UNIX platform,
The use of C + + development system sometimes has a segment error, that is, segment Fault. This kind of error program crashes directly, usually without any useful information output, it is difficult to locate the bug, so it is impossible to solve
Disclaimer: The blog content refers to Mr. Chen's blog post, the original link http://blog.csdn.net/haoel/article/details/2879. Since the original blog post does not have a directory, inconvenient to query, so the original blog post is organized
This article provides a brief introduction to the core file and gdb Debug Core file methodProfile:1. Core file2. Configure the core program to generate files when it crashes 3. Can modify the core file name4. The case where the core file is
GDB Basic Commands This article describes common commands for using the GDB debugger. Main content: [introduction] [Example] [other] [introduction]=============GDB is a powerful UNIX program debugging tool released by the GNU Open source
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.